Previous Book Contents Book Index Next

Inside Macintosh: AppleScript Language Guide / Part 2 - AppleScript Language Reference
Chapter 7 - Control Statements / Try Statements


Writing a Try Statement

A Try statement is two-part compound statement. The first part, which begins with the word try, is a collection of AppleScript statements. The second part, which begins with the words on error, is an error handler--a series of statements that is executed if any of the statements in the first part causes an error message. The Try statement ends with the word end (followed optionally by error or try).

The error handler can include up to five parameter variables (also called formal parameters) that represent the actual information sent in the error message when the error occurs. When the error handler is called, the parameter variables become local variables in the error handler.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
13 JUL 1996